lib/sysroot: Add wrapper API to prune system repository
authorColin Walters <walters@verbum.org>
Mon, 30 Apr 2018 15:19:17 +0000 (11:19 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 24 May 2018 12:56:11 +0000 (12:56 +0000)
commit9131d8a4cc28ea498c2ebc058aac73f70d41841c
treeb1732a91526f3e39b72d36eb34d26601679d84f6
parent371081d123a9263d8dbdd4dad69c0468e2db427d
lib/sysroot: Add wrapper API to prune system repository

The initial motivation for this is that the "staging" code currently
didn't rewrite the deployment refs, meaning that the staged commit
could be pruned.

Hence first, this new API ensures that deployments also
hold a strong ref to their commit, without relying on the magical
"deployment refs" that we inject.  That has always been a weird
artifact of the strict layering separation between OstreeSysroot
and OstreeRepo.

I also plan to change rpm-ostree to start using this API to
hold references to base layers for client-side layering; it also
today generates various refs.

That said, if we still want to support multiple processes
writing to a single repo (as happens on EndlessOS today) we
still need to write refs; perhaps later we could add a concept
of "generators" or something that create refs based on whatever
logic?

Another minor thing this fixes is that we had a printf inside
the library; this propagates the pruned data to the higher level
which can log however it likes.

Closes: #1566
Approved by: jlebon
apidoc/ostree-sections.txt
src/libostree/libostree-devel.sym
src/libostree/ostree-sysroot-cleanup.c
src/libostree/ostree-sysroot.h